﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="EbayActiveListing.aspx.cs" Inherits="UI_Bas_EbayActiveListing" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>EbayActiveListing管理</title> 
    <link href="../../css/admin.css" rel="stylesheet" type="text/css" />  
    
    <link href="../../js/jquery.easyui/themes/default/easyui.css" rel="stylesheet" type="text/css" />
    <link href="../../js/jquery.easyui/themes/icon.css" rel="stylesheet" type="text/css" />
    <script src="../../js/jquery.easyui/jquery.min.js" type="text/javascript"></script>
    <script src="../../js/jquery.easyui/jquery.easyui.min.js" type="text/javascript"></script>
    <script src="../../js/jquery.easyui/locale/easyui-lang-zh_CN.js" type="text/javascript"></script>
  
    <script type ="text/javascript" >
        $(function () {
            $("#ddlebayUserId").combobox({
                editable: false
            });
            $("#ddlOnLineStatus").combobox({
                editable: false
            });

            var defaultDate = Date.parse('1900/01/01');
            var _$ebayActiveListing = $("#ebayActiveListing");
            _$ebayActiveListing.datagrid({
                border: true,
                height: 650,
                title: 'EbayActiveListing列表...',
                remoteSort: true,
                nowrap: true,
                striped: false,
                url: "../../TableHanders.aspx?act=q&tid=38&type=0",
                pageSize:50,
                sortName: 'ItemId',
                sortOrder: 'desc',
                loadMsg: "正在加载,请稍后...",

                frozenColumns: [[
	                { title: 'EbayUserId', field: 'EbayUserId', width: 90, sortable: true },
	                { title: 'ItemId', field: 'ItemId', width: 120, sortable: true }
				  ]],
                columns: [[
	                { title: 'ItemTitle', field: 'ItemTitle', width: 500, sortable: true },
	                { title: 'QuantityAvailable', field: 'QuantityAvailable', width: 120, sortable: true, align: 'right' },
	                { title: 'Purchases', field: 'Purchases', width: 80, sortable: true, align: 'right' },
	                { title: 'Bids', field: 'Bids', width: 90, sortable: true, align: 'right' },
	                { title: 'Price', field: 'Price', width: 85, sortable: true, align: 'right' },
	                { title: 'Type', field: 'Type', width: 90, sortable: true },
	                { title: 'CustomLable', field: 'CustomLable', width: 230, sortable: true },
	                { title: 'Listing', field: 'Listing', width: 300, sortable: true },
                    { title: 'OnlineStatus', field: 'OnlineStatus', width: 85, sortable: true },
                    { title: 'SellingFormat', field: 'SellingFormat', width: 85, sortable: true },
                    { title: 'WhCode', field: 'WhCode', width: 85, sortable: true },
                    { title: 'ParcelType', field: 'ParcelType', width: 85, sortable: true },
                    { title: 'LogonCountry', field: 'LogonCountry', width: 85, sortable: true },
                    { title: 'OriginalPrice', field: 'OnSalePrice', width: 85, sortable: true, align: 'right' },
                    { title: 'Msg', field: 'Msg', width: 130, sortable: true },
                    { title: 'ProdLevel', field: 'ProdLevel', width: 130, sortable: true },
	                { title: 'DownLoadDate', field: 'DownLoadDate', width: 120, sortable: true, formatter: function (val) {
	                    var d = Date.parse(val.replace("-", "/"));
	                    if (d == defaultDate) {
	                        return "";
	                    }
	                    else {
	                        return val;
	                    }
	                }
	                },
	                { title: 'StartDate', field: 'StartDate', width: 120, sortable: true, formatter: function (val) {
	                    var d = Date.parse(val.replace("-", "/"));
	                    if (d == defaultDate) {
	                        return "";
	                    }
	                    else {
	                        return val;
	                    }
	                }
	                },
	                { title: 'EndDate', field: 'EndDate', width: 120, sortable: true, formatter: function (val) {
	                    var d = Date.parse(val.replace("-", "/"));
	                    if (d == defaultDate) {
	                        return "";
	                    }
	                    else {
	                        return val;
	                    }
	                }
	                }
				  ]],
                pagination: true,
                rownumbers: true,
                singleSelect: true,
                pageList: [10, 15, 20,50,100],
                onDblClickRow: function (rowIndex, rowData) {
                    var id = rowData.ItemId;
                    var id2 = rowData.EbayUserId;
                    window.showModalDialog("EbayActiveListingDetail.aspx?act=view&id=" + id + "&id2=" + id2 + "&ts=" + new Date().getTime(), "", "dialogHeight:380px;dialogWidth:850px;edge:Raised;center:Yes;help:No;resizable:no;status:no; scroll:no;location=no;");
                },
                queryParams: {
                    "ebayUserId": "",
                    "timeFrom": "",
                    "timeTo": "",
                    "iType": "0",
                    "listing": ""
                }
            });
            $("#btnQuery").click(function () {
                if (!$("#divContent").form('validate'))
                    return;
                var iType = "0";
                if ($("#chkerror").attr("checked")) {
                    iType = "1";
                }
                var ebayUserId = $("#ddlebayUserId").combobox('getValue');
                var ItemId = $("#txtItemId").val();
                var ItemTitle = $("#txtItemTitle").val();
                var CustomLable = $("#txtCustomLable").val();
                var Listing = $("#txtListing").val();
                var OnLineStatus = $("#ddlOnLineStatus").combobox('getValue');
                _$ebayActiveListing.datagrid({
                    queryParams: {
                        "ebayUserId": ebayUserId,
                        "ItemId": ItemId,
                        "ItemTitle": ItemTitle,
                        "CustomLable": CustomLable,
                        "iType": iType,
                        "listing": Listing,
                        "OnLineStatus": OnLineStatus
                    }
                });
            });
        });
	</script>	
</head>
<body>
  <div class="div_Title">
    <span class="Body_Title">》》<%=this.Title %></span>
   </div>    
 <div id= "divContent" class ="easyui-panel" title ="请输入查询条件..." style="margin-bottom:5px;">
    <form id="formQuery" runat="server">      
       <table>
             <tr>
                <td>帐号:</td>
                <td><select ID="ddlebayUserId" runat="server" style="width:206px "></select></td>
                <td>ItemId:</td>
                <td><input type ="text" ID ="txtItemId" runat="server" style ="width :200px"/></td>
                <td>错误筛选:</td>
                <td style = "vertical-align:middle"><input id="chkerror" type="checkbox" name="chkerror" /><label for="chkerror">筛选无法解析的CustomLable</label></td>
             </tr>
             <tr>
                <td>Listing</td>
                <td><input type ="text" ID="txtListing"  runat="server" style ="width :200px" /></td>
                <td>ItemTitle:</td>
                <td><input type ="text" ID="txtItemTitle"  runat="server" style ="width :200px" /></td>
                <td>CustomLable:</td>
                <td><input type ="text" ID="txtCustomLable"  runat="server" style ="width :200px" /></td>
                <td>是否在线:</td>
                <td><select ID="ddlOnLineStatus" runat="server" style="width:150px "></select></td>
                <td><a id="btnQuery"  href ="#"  class="easyui-linkbutton" icon="icon-search" >Query</a></td>
                <td>                   
                    <asp:LinkButton ID="btnExport" CssClass = "easyui-linkbutton" Text=" 导  出 " runat="server" onclick="btnExport_Click"></asp:LinkButton> </td>
             </tr>
        </table>
        </form>  
       </div>     
    <div id="divData">
        <table id="ebayActiveListing" ></table>
    </div>    
</body>
</html>